import request from '@/utils/request'

export function initPrimaryTable() {
  return request({
    url: '/TakeMaterial/requisition-header/selectByStatus',
    method: 'get',
    params: {
      status: '完成'
    }
  })
}

export function initSubTableSource() {
  return request({
    url: '/TakeMaterial/material-requisition/selectByHeaderStatus',
    method: 'get',
    params: {
      status: '完成'
    }
  })
}

export function updateMaterialRequisition(updForm) {
  return request({
    url: '/TakeMaterial/material-requisition/deliveryEdit',
    method: 'post',
    headers: {
      'Content-Type': 'application/json'
    },
    data: updForm
  })
}

export function deliveryCancel(requisitionId) {
  return request({
    url: '/TakeMaterial/requisition-header/deliverCancel',
    method: 'post',
    params: {
      requisitionId: requisitionId
    }
  })
}

export function deliveryConfirm(deliveryInfo) {
  return request({
    url: '/deliveryManagement/out-form/delivery',
    method: 'post',
    headers: {
      'Content-Type': 'application/json'
    },
    data: deliveryInfo
  })
}

export function initStoreInform() {
  return request({
    url: '/deliveryManagement/store-inform/selectAll',
    method: 'get'
  })
}
